<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        // 管理员表
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
	        $table->string('username',20)->default('')->comment('用户名');
	        $table->string('password',255)->default('')->comment('密码');
	        $table->string('avator',255)->default('')->comment('头像');
	        $table->string('email',255)->default('')->comment('邮箱');
	        $table->string('openid',255)->default('')->comment('openid');
	        $table->string('phone',20)->default('')->comment('手机号');
	        $table->char('ip',15)->default('')->comment('IP地址');
	        $table->unsignedInteger('role_id')->default(0)->comment('角色ID');
	        $table->timestamps();
	        $table->softDeletes();
	        $table->rememberToken();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
